package com.zxmc.server.mapper;

import com.zxmc.aop.AutoFill;
import com.zxmc.enumeration.OperationType;
import com.zxmc.pojo.dto.UserLoginDto;
import com.zxmc.pojo.entity.Admin;
import com.zxmc.pojo.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AdminMapper {
    @Select("select * from admin where username=#{username}")
    Admin list(UserLoginDto userLoginDto);

    @AutoFill(OperationType.INSERT)
    @Insert("insert into admin (username, password, created_at) values (#{username},#{password},#{createdAt});")
    void insert(Admin admin);

    @Select("select * from admin where id=#{userId}")
    Admin listById(Integer userId);


    void update(Admin admin);
}
